package com.hawthorn.admin.repository.provider;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.builder.annotation.ProviderMethodResolver;

import java.util.Map;

/**
 * @version v1.0.1
 * @Copyright: Copyright (c) $
 * @remark: TODO 演示账号维护sql层
 * @author:zhangzhexu
 * @date:2023/3/21$ 13:22$
 */
public class ShowUserApplySqlProvider implements ProviderMethodResolver
{
  /**
   * @remark:演示账号维护主页面查询
   * @param: page
   * @param: conditions
   * @return: java.lang.String
   * @author: zhangzx
   * @date: 2023/3/21 21:13
   * @version: 1.0.1
   * Modification History:
   * Date       Author       Version          Description
   * -----------------------------------------------------------
   * 2023/3/21  zhangzx       v1.0.1          init
   */
  public static String findShowUserApply(Page<Map<String, Object>> page, String conditions)
  {
    StringBuffer sql = new StringBuffer();
    sql.append("select \n");
    sql.append("  id, \n");
    sql.append("  phone, \n");
    sql.append("  user_name userName, \n");
    sql.append("  customer_id customerId, \n");
    sql.append("  customer_dept_id customerDeptId, \n");
    sql.append("  customer_code customerCode, \n");
    sql.append("  customer_name customerName, \n");
    sql.append("  brand_id brandId, \n");
    sql.append("  brand_name brandName, \n");
    sql.append("  apply_status applyStatus, \n");
    sql.append("  remark, \n");
    sql.append("  last_update_by lastUpdateBy, \n");
    sql.append("  last_update_time lastUpdateTime \n");
    sql.append("from \n");
    sql.append("  base_show_user_apply \n");
    sql.append("where \n");
    sql.append(conditions + " \n");
    return sql.toString();
  }

  /**
   * @remark:查询演示账号更改日志方法
   * @param: page
   * @param: conditions
   * @return: java.lang.String
   * @author: zhangzx
   * @date: 2023/3/21 21:13
   * @version: 1.0.1
   * Modification History:
   * Date       Author       Version          Description
   * -----------------------------------------------------------
   * 2023/3/21  zhangzx       v1.0.1          init
   */
  public static String findShowUserApplyLog(Page<Map<String, Object>> page, String conditions)
  {
    StringBuffer sql = new StringBuffer();
    sql.append("select \n");
    sql.append("  id, \n");
    sql.append("  operate, \n");
    sql.append("  create_by createBy, \n");
    sql.append("  create_time createTime \n");
    sql.append("from \n");
    sql.append("  base_show_user_apply_log \n");
    sql.append("where \n");
    sql.append(conditions + " \n");
    return sql.toString();
  }

  public static String findInventedCustomer()
  {
    StringBuffer sql = new StringBuffer();
    sql.append("select \n");
    sql.append("  id customerId, \n");
    sql.append("  dept_id customerDeptId, \n");
    sql.append("  customer_code customerCode, \n");
    sql.append("  customer_name customerName \n");
    sql.append("from \n");
    sql.append("  base_customer \n");
    sql.append("where \n");
    sql.append("  customer_code = '999999' \n");
    return sql.toString();
  }
}
